<%@ page language="java" isELIgnored="false" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
	import="java.net.URLEncoder"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录信息</title>
<link href="<%=request.getContextPath() %>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/show.js"></script>
<link href="<%=request.getContextPath()%>/fare/css/base.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/fare/js/datePicker/WdatePicker.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/jsFile/js_new/jquery.1.7.2.js" type="text/javascript"></script> 
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.all.js"></script>
 <script src="<%=request.getContextPath()%>/fare/lib/jquery/jquery.form.js"	type="text/javascript"></script>
<%-- <script src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script> --%>
<%-- <script src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script> --%>
<link rev="stylesheet" media="all" href="<%=request.getContextPath() %>/fare/css/form_style.css" type="text/css" rel="stylesheet" />
<script src="<%=request.getContextPath()%>/fare/js/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<%-- <script src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script> --%>
<%-- <script src="<%=request.getContextPath()%>/fare/js/ligerUI/js/core/base.js" type="text/javascript"></script> --%>
<script src="<%=request.getContextPath()%>/fare/lib/json2.js" type="text/javascript"></script>
<%-- <link href="<%=request.getContextPath()%>/fare/js/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" /> --%>
<script type="text/javascript">


$(document).ready(function () {
	var $j = jQuery.noConflict();/* 这个很重要的，如果删除后面的ligerUI就用不了 */
	var griddata=${data};
	initializeP();
	manager=jQuery("#maingrid").ligerGrid({
		    dataAction : 'server',
		    title:'日志信息',
			showTitle:true,
		    columns : columns,
		    data: { Rows: griddata },
		  //  url:url,
		    height: '80%',
	        width: '100%',
	        pageSizeOptions : [20,40,50,100],
			pageSize:20, 
			pagesizeParmName:'pagesize' ,
			 rownumbers:false,
            /* enabledEdit: true,
            checkbox : false,
            clickToEdit:false,  */
	        isScroll: false,
	        usePager:true,
	    //    AllowPaging:true,
           heightDiff: 100
			 
	 	});   
});

/* 清空 数据
 */
function clearcontent(){	
	jQuery("#queryDate").val("");
	jQuery("#queryDate2").val("");
}


function initializeP(){
	if(jQuery("#startTimeStr").val() !=null && jQuery("#startTimeStr").val() !=""){
		jQuery("#queryDate").val(jQuery("#startTimeStr").val());
	}
	if(jQuery("#ednTimeStr").val() !=null && jQuery("#ednTimeStr").val() !=""){
		jQuery("#queryDate2").val(jQuery("#ednTimeStr").val());
	}

}

function find(){
	jQuery.noConflict();   
	var logoutTimeStr=jQuery("#queryDate2").val();	
	var loginTimeStr=jQuery("#queryDate").val();
	if(logoutTimeStr !=null && logoutTimeStr!=""){
		jQuery("#ednTimeStr").val(logoutTimeStr)
	}
	if(loginTimeStr !=null && loginTimeStr!=""){
		jQuery("#startTimeStr").val(loginTimeStr)
	}
	jQuery("#dataForm").attr("action","<%=request.getContextPath()%>/system/log/toUserInfoLogJSP.action?loginTimeStr="+loginTimeStr+"&logoutTimeStr="+logoutTimeStr);
	jQuery("#dataForm").submit();
}

var columns= [
  			{ display: '序号', name: 'rowId', width: 40, 
  				render: function(data, index) { 
  					return (this.options.page-1)*this.options.pageSize+index+1;
  					} 
  			}, 
     			{ display: '用户名',    name: 'userName',width:180,align:'center'},
              { display: '登录时间', name: 'loginTimeStr',width:160,align:'center',isSort:true},
              { display: '退出时间', name: 'logoutTimeStr',width:160,align:'center',isSort:true},
              { display: '在线时间', name: 'onlineTimeStr',width:80,align:'center', isSort:false},
              { display: '登录IP', name: 'IP', width:250 ,align:'center'},
              { display: '状态',   width:40 ,align:'center',
            	  render:function (row){
            		  if(row.logoutTimeStr !=null && row.logoutTimeStr !=""){
            			  return "<b>离线</b>";
            		  }else{
            			  return "<b style=\'color:red\'>在线</b>";
            		  }
            	  }
              }
              ];
</script>
</head>
<body >
	<div class="form_body">
		<div class="">
			<div class="form_table_tltle">用户登录信息</div>
			<%-- 生成form--%>
			<form id="dataForm" method="post" action="">
				<input type="hidden" name="startTimeStr" id="startTimeStr" value=" " />
				<input type="hidden" name="ednTimeStr" id="ednTimeStr" value="" />
				<table width="0" border="0" cellpadding="0" cellspacing="0" class="form_table">
					<tr>
						<td class="left" name="" id="" style="width:160PX">当前在线人数:<span style="color: #ff0000">${count}</span>人</td>
						
						<td class="left" name="" id="">登录时间:</td>
						<td>
						<input name="loginTimeStr" type="text"	id="queryDate" style="width: 120px"    
					onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly"/>
						</td>
						
						<td class="left" name="" id="">退出时间：</td>
						<td>
						<input name="logoutTimeStr" type="text" id="queryDate2" style="width: 120px;"    
					onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly"/>
						</td>
						
						
						
						<TD><img
							src="<%=request.getContextPath() %>/fare/images/but_01.png"
							name="querybutton" id="querybutton"
							onclick="javascript:find();" /> <img
							src="<%=request.getContextPath() %>/fare/images/but_02.png"
							name="cancelbutton" id="cancelbutton"
							onclick="javascript:clearcontent();" /></TD>
					</tr>

				</table>
			</form>
			<!-- <div class="high_10"></div> -->
			<div id="maingrid" style="margin-top: 20px;"></div>
			

		</div>
	</div>

</body>
</html>